/*
 * @Author: XieQiu 雪球
 * @Date: 2021-05-21 08:57:52
 * @LastEditTime: 2021-05-21 11:25:31
 * @LastEditors: XieQiu 雪球
 * @Description: 种养品种管理接口
 */
import xjaxios from "@/api/axios";
export default {
  /**
   * @description: 获取种养品种列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
  */
  getplantVarietyList(params) {
    return xjaxios.post("/plantVariety/queryPageList", {
      page: params.page,
      size: params.size,
      entity: {
        // organizationNo: sessionStorage.organizationNo,
        varietyName: params.varietyName
      }
    });
  },
  // /v2
  getplantVariety(farmingTypeNo, params) {
    return xjaxios.post(`/plantVariety/v2/queryPageList/${farmingTypeNo}`, params);
  },
  /**
   * @description: 新增种养品种信息
   * @param {Object} formData *
   * @return {Object}
   */
  addplantVarietyInfo(formData) {
    return xjaxios.post("/plantVariety/add", formData);
  },
  /**
   * @description: 编辑种养品种信息
   * @param {Object} formData *
   * @return {Object}
   */
  editplantVarietyInfo(formData) {
    return xjaxios.post("/plantVariety/edit", formData);
  },
  /**
   * @description: 批量删除数据
   * @param {Array} plantingTypeIdList *
   * @return {Object}
   */
  delplantVarietyListInfo(list) {
    return xjaxios.post("/plantVariety/delList", { plantVarietyIdList: list });
  },

  /**
   * @description: 批量查询种养品种
   * @param null
   * @return {Array}
   */
  queryplantVariety(params) {
    return xjaxios.post("/plantVariety/queryList", {
      entity: {
        varietyName: params.varietyName
      }
    });
  },
  queryplantVarietyList(params) {
    return xjaxios.get("plantVariety/list");
  },
  getplantVarietyUpload(file) {
    return xjaxios.post(`plantVariety/upload`, file);
  }
};
